import request from '@/utils/request'

export function login(data) {
  return request({
    url: `/api/v1/login`,
    method: 'post',
    data
  })
}

export function getMyPermissions(token) {
  return request({
    url: `/api/v1/getMyPermissions`,
    method: 'get'
  })
}

export function getMyInfo() {
  return request({
    url: `/api/v1/getMyInfo`,
    method: 'get'
  })
}

export function getMyCompanyInfo() {
  return request({
    url: `/api/v1/getMyCompanyInfo`,
    method: 'get'
  })
}

export function getStationList(whereCompanyId) {
  return request({
    url: `/api/v1/getStationList?permission=stationList&whereCompanyId=${whereCompanyId}`,
    method: 'get'
  })
}

export function getCompanyList() {
  return request({
    url: `/api/v1/getCompanyList?permission=companyList`,
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/api/v1/logout',
    method: 'get'
  })
}
